package com.tool.emulator.apple2.wave;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * FileWaveOutputer.java @author tl 2011-6-26
 */
public class FileWaveOutputer extends WaveOutputer {
	protected final File file;

	public FileWaveOutputer(long deviceFreq, File file) throws IOException {
		super(deviceFreq, new BufferedOutputStream(new FileOutputStream(file)));
		this.file = file;
	}

	public File getFile() {
		return this.file;
	}

	public synchronized void finish() throws IOException {
		super.closeAndUpdate(this.getFile());
	}
}
